#pragma once

#include "Types.h"

namespace Vortex { namespace Wrapper { namespace Direct3D {

	public value struct PresentParameters {
		UINT                BackBufferWidth;
		UINT                BackBufferHeight;
		D3DFormat			BackBufferFormat;
		UINT                BackBufferCount;
		D3DMultisampleType	MultiSampleType;
		DWORD               MultiSampleQuality;
		D3DSwapEffect		SwapEffect;
		IntPtr              DeviceWindow;
		bool                Windowed;
		bool                EnableAutoDepthStencil;
		D3DFormat			AutoDepthStencilFormat;
		DWORD               Flags;
		UINT                FullScreen_RefreshRateInHz;
		D3DPresentInterval  PresentationInterval;

		D3DPRESENT_PARAMETERS ToD3DPRESENT_PARAMETERS() {
			D3DPRESENT_PARAMETERS pp;
			pp.BackBufferWidth = BackBufferWidth;
			pp.BackBufferHeight = BackBufferHeight;
			pp.BackBufferFormat = (D3DFORMAT)BackBufferFormat;
			pp.BackBufferCount = BackBufferCount;
			pp.MultiSampleType = (D3DMULTISAMPLE_TYPE)MultiSampleType;
			pp.MultiSampleQuality = MultiSampleQuality;
			pp.SwapEffect = (D3DSWAPEFFECT)SwapEffect;
			pp.hDeviceWindow = (HWND)DeviceWindow.ToPointer();
			pp.Windowed = Windowed;
			pp.EnableAutoDepthStencil = EnableAutoDepthStencil;
			pp.AutoDepthStencilFormat = (D3DFORMAT)AutoDepthStencilFormat;
			pp.Flags = Flags;
			pp.FullScreen_RefreshRateInHz = FullScreen_RefreshRateInHz;
			pp.PresentationInterval = (UINT)PresentationInterval;

			return pp;
		}
	};

} } }